package com.kakarote.hrm.constant;

import com.kakarote.core.common.enums.SystemCodeEnum;
import com.kakarote.core.exception.CrmException;


/**
 * 审核状态枚举 0 待审核、1通过、2拒绝、3审核中 4:撤回 5 未提交 6 创建 7 已删除 8 作废 10 忽略 即未启用审批流 ,11 转发,12 征求他人意见,13终止 14委托
 */
public enum HrmExamineStatusEnum {
    AWAIT(0, "待审核"),
    PASS(1, "审核通过"),
    REJECT(2, "拒绝"),
    UNDERWAY(3, "审核中"),
    RECHECK(4, "撤回");

    HrmExamineStatusEnum(Integer status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    private final Integer status;
    private final String msg;

    public Integer getStatus() {
        return status;
    }

    public String getMsg() {
        return msg;
    }

    public static HrmExamineStatusEnum parse(Integer status) {
        for (HrmExamineStatusEnum examineStatusEnum : values()) {
            if (examineStatusEnum.getStatus().equals(status)) {
                return examineStatusEnum;
            }
        }
        throw new CrmException(SystemCodeEnum.SYSTEM_NO_VALID);
    }
}
